"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _configContext = require("../../../../extends/configContext");

var _classnames = _interopRequireDefault(require("classnames"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var BgView = function BgView(_ref) {
  var leftChildren = _ref.leftChildren,
      rightChildren = _ref.rightChildren,
      _ref$isPlay = _ref.isPlay,
      isPlay = _ref$isPlay === void 0 ? false : _ref$isPlay;

  var _useConfig = (0, _configContext.useConfig)(),
      clsPrefix = _useConfig.clsPrefix;

  var renderLeft = function renderLeft() {
    return /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(clsPrefix, "-audio-bg-view__left")
    }, leftChildren);
  };

  var renderCenter = function renderCenter() {
    var hzViewItems = [];

    for (var index = 0; index < 20; index++) {
      hzViewItems.push( /*#__PURE__*/_react.default.createElement("div", {
        className: (0, _classnames.default)("".concat(clsPrefix, "-audio-bg-view__hz-").concat(index + 1), _defineProperty({}, "".concat(clsPrefix, "-audio-bg-view__hz-").concat(index + 1, "--animation"), isPlay)),
        key: index
      }));
    }

    return /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(clsPrefix, "-audio-bg-view__center")
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(clsPrefix, "-audio-bg-view__hz")
    }, hzViewItems));
  };

  var renderRight = function renderRight() {
    return /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(clsPrefix, "-audio-bg-view__right")
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(clsPrefix, "-audio-bg-view__right-text")
    }, rightChildren));
  };

  return /*#__PURE__*/_react.default.createElement("div", {
    className: "".concat(clsPrefix, "-audio-bg-view")
  }, renderLeft(), renderCenter(), renderRight());
};

var _default = BgView;
exports.default = _default;